package com.heima.article.controller.v1;

import com.heima.article.service.ApArticleService;
import com.heima.article.service.ApCollectionBehaviorService;
import com.heima.model.behavior.dtos.CollectionBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: ApCollectionController
 * Description:
 * date: 2023/8/25 0025 16:42
 *
 * @author zHan
 */
@RestController
@Slf4j
@Api(tags = "收藏相关接口")
@RequestMapping("/api/v1")
public class ApCollectionController {

    @Autowired
    private ApArticleService apArticleService;

    @Autowired
    private ApCollectionBehaviorService apCollectionBehaviorService;

    /**
     * 文章收藏
     * @param dto
     * @return
     */
    @PostMapping("/collection_behavior")
    @ApiOperation("文章收藏")
    public ResponseResult collectionBehavior(@RequestBody CollectionBehaviorDto dto) {
        return apCollectionBehaviorService.collectionBehavior(dto);
    }
}
